package bean;

import java.io.File;

import util.ODocument;
import util.OImage;
import util.OPrint;
import util.OTable;

public class MSword {
	private String MSwordPath;
	private String HtmlPath;
	private String HtmlName;
	
	public MSword(String mspath,String htmlPath,String name){
		this.MSwordPath = mspath;
		this.HtmlPath = htmlPath;
		this.HtmlName = name;
	}
	
	public String getHtmlPath(){
		return this.HtmlPath;
	}
	public String writeHtml(){
		ODocument doc = new ODocument(MSwordPath);
		OTable otable = new OTable(doc.getDocument());
		String htmlData = otable.replaceHtmlTable(doc.readDoc());
		String content = htmlData;
		content = content.substring(0, 32);
		content = content.replaceAll(" ||\n||\t", "");
		OImage oimage = new OImage(doc.getDocument(),HtmlPath);
		htmlData = oimage.replaceImg(htmlData);
		OPrint oprint = new OPrint();
		oprint.printHtml(htmlData, HtmlPath,HtmlName);
		return content;
	}

}
